package com.hspedu.homework;

/**
 * @author 谷其昊
 * @version 1.0
 * @date 2022/1/29
 * @time 18:26
 */
public class Homework02 {
    public static void main(String[] args) {
        Frock frock = new Frock();
        Frock frock2 = new Frock();
        Frock frock3 = new Frock();
        System.out.println(frock.getSerialNumber());
        System.out.println(frock2.getSerialNumber());
        System.out.println(frock3.getSerialNumber());
    }
}

class Frock{
    private static int currentNum = 100000;
    private int serialNumber;

    public static int getNextNum(){
        Frock.currentNum += 100;
        return Frock.currentNum;
    }

    public int getSerialNumber() {
        return serialNumber;
    }

    public Frock(){
        this.serialNumber = getNextNum();
    }

}
